package com.minimalist.basic.entity.po.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class MPermsTableDef extends TableDef {

    /**
     * 权限表 实体类。

 @author 小太阳
 @since 2024-10-18
     */
    public static final MPermsTableDef MPERMS = new MPermsTableDef();

    /**
     * ID自增
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 权限ID
     */
    public final QueryColumn PERM_ID = new QueryColumn(this, "perm_id");

    /**
     * 备注
     */
    public final QueryColumn REMARK = new QueryColumn(this, "remark");

    /**
     * 状态  0禁用 1正常
     */
    public final QueryColumn STATUS = new QueryColumn(this, "status");

    /**
     * 逻辑删除
     */
    public final QueryColumn DELETED = new QueryColumn(this, "deleted");

    /**
     * 版本号
     */
    public final QueryColumn VERSION = new QueryColumn(this, "version");

    /**
     * 是否可见 0隐藏 1显示）
     */
    public final QueryColumn VISIBLE = new QueryColumn(this, "visible");

    /**
     * 创建人ID
     */
    public final QueryColumn CREATE_ID = new QueryColumn(this, "create_id");

    /**
     * 权限标识
     */
    public final QueryColumn PERM_CODE = new QueryColumn(this, "perm_code");

    /**
     * 权限图标 菜单或目录时可传图标
     */
    public final QueryColumn PERM_ICON = new QueryColumn(this, "perm_icon");

    /**
     * 权限名称
     */
    public final QueryColumn PERM_NAME = new QueryColumn(this, "perm_name");

    /**
     * 路由地址
     */
    public final QueryColumn PERM_PATH = new QueryColumn(this, "perm_path");

    /**
     * 显示顺序
     */
    public final QueryColumn PERM_SORT = new QueryColumn(this, "perm_sort");

    /**
     * 权限类型  M菜单 B按钮
     */
    public final QueryColumn PERM_TYPE = new QueryColumn(this, "perm_type");

    /**
     * 更新人ID
     */
    public final QueryColumn UPDATE_ID = new QueryColumn(this, "update_id");

    /**
     * 组件路径
     */
    public final QueryColumn COMPONENT = new QueryColumn(this, "component");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 更新时间
     */
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 是否为外部链接  0否 1是
     */
    public final QueryColumn EXTERNAL_LINK = new QueryColumn(this, "external_link");

    /**
     * 父权限ID
     */
    public final QueryColumn PARENT_PERM_ID = new QueryColumn(this, "parent_perm_id");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, PERM_ID, REMARK, STATUS, VERSION, VISIBLE, CREATE_ID, PERM_CODE, PERM_ICON, PERM_NAME, PERM_PATH, PERM_SORT, PERM_TYPE, UPDATE_ID, COMPONENT, CREATE_TIME, UPDATE_TIME, EXTERNAL_LINK, PARENT_PERM_ID};

    public MPermsTableDef() {
        super("", "m_perms");
    }

    private MPermsTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    @Override
    public MPermsTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new MPermsTableDef("", "m_perms", alias));
    }

}
